use std::collections::HashMap;
use serde::{Serialize, Deserialize};

/// 处理方法
///
/// * api:https://api.uyiban.com/workFlow/c/my/getProcessDetail
/// * query:WFId，CSRF

#[derive(Debug, Serialize, Deserialize)]
pub struct ProcessDetail {
    pub list: Vec<List>,
    pub kv: Kv,
    #[serde(rename = "personInfo")]
    pub person_info: PersonInfo,
}

#[derive(Debug, Serialize, Deserialize)]
pub struct Kv {
    pub person: Option<serde_json::Value>,
    pub org: Option<serde_json::Value>,
    pub role: HashMap<String, Role>,
}

#[derive(Debug, Serialize, Deserialize)]
pub struct Role {
    #[serde(rename = "Id")]
    pub id: String,
    #[serde(rename = "RoleName")]
    pub role_name: String,
}

#[derive(Debug, Serialize, Deserialize)]
pub struct List {
    #[serde(rename = "Id")]
    pub id: String,
    #[serde(rename = "UniversityId")]
    pub university_id: String,
    #[serde(rename = "WFId")]
    pub wf_id: String,
    #[serde(rename = "PIndex")]
    pub p_index: i64,
    #[serde(rename = "Cond")]
    pub cond: Option<serde_json::Value>,
    #[serde(rename = "RulePersonCond")]
    pub rule_person_cond: String,
    #[serde(rename = "Flow")]
    pub flow: Vec<Option<serde_json::Value>>,
    #[serde(rename = "CCTrigger")]
    pub cc_trigger: String,
    #[serde(rename = "CC")]
    pub cc: Cc,
    #[serde(rename = "State")]
    pub state: i64,
    #[serde(rename = "CreateTime")]
    pub create_time: i64,
}

#[derive(Debug, Serialize, Deserialize)]
pub struct Cc {
    pub rulerole: Vec<String>,
}

#[derive(Debug, Serialize, Deserialize)]
pub struct PersonInfo {
    #[serde(rename = "Id")]
    pub id: String,
    #[serde(rename = "UniversityId")]
    pub university_id: String,
    #[serde(rename = "Name")]
    pub name: String,
    #[serde(rename = "Gender")]
    pub gender: i64,
    #[serde(rename = "CollegeId")]
    pub college_id: String,
    #[serde(rename = "FacultyId")]
    pub faculty_id: Option<serde_json::Value>,
    #[serde(rename = "ProfessionId")]
    pub profession_id: String,
    #[serde(rename = "SpecialtyId")]
    pub specialty_id: Option<serde_json::Value>,
    #[serde(rename = "ClassId")]
    pub class_id: String,
    #[serde(rename = "Grade")]
    pub grade: i64,
    #[serde(rename = "EducationLevel")]
    pub education_level: i64,
    #[serde(rename = "StudyYear")]
    pub study_year: String,
    #[serde(rename = "Number")]
    pub number: String,
    #[serde(rename = "ExamNo")]
    pub exam_no: Option<serde_json::Value>,
    #[serde(rename = "AdmissionNo")]
    pub admission_no: Option<serde_json::Value>,
    #[serde(rename = "IDCardNo")]
    pub id_card_no: Option<serde_json::Value>,
    #[serde(rename = "Mobile")]
    pub mobile: Option<serde_json::Value>,
    #[serde(rename = "MobileState")]
    pub mobile_state: i64,
    #[serde(rename = "Email")]
    pub email: Option<serde_json::Value>,
    #[serde(rename = "EmailState")]
    pub email_state: i64,
    #[serde(rename = "State")]
    pub state: i64,
    #[serde(rename = "IsFreeze")]
    pub is_freeze: i64,
    #[serde(rename = "Campus")]
    pub campus: String,
    #[serde(rename = "IsArchived")]
    pub is_archived: i64,
    #[serde(rename = "Remark")]
    pub remark: Option<serde_json::Value>,
    #[serde(rename = "CreateTime")]
    pub create_time: i64,
    #[serde(rename = "UpdateTime")]
    pub update_time: i64,
    #[serde(rename = "PersonType")]
    pub person_type: String,
    #[serde(rename = "CollegeName")]
    pub college_name: String,
    #[serde(rename = "FacultyName")]
    pub faculty_name: String,
    #[serde(rename = "ProfessionName")]
    pub profession_name: String,
    #[serde(rename = "SpecialtyName")]
    pub specialty_name: String,
    #[serde(rename = "ClassName")]
    pub class_name: String,
}
